<!DOCTYPE html>
<html>
<head>
    <title>Leaflet WMTS Example</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
    <style>
        #map {
            height: 400px;
        }
    </style>
</head>
<body>
<div id='map'></div>

<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="leaflet-tilelayer-wmts.js"></script>
<script>
    var map = L.map('map').setView([32.0603, 118.7969], 9);


    // 添加底图（例如OpenStreetMap）
    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 19,
        attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
    }).addTo(map);

    // 添加WMTS图层
    var wmtsLayer = L.tileLayer.wms('http://localhost:8210/wmts', {
        layers: '202005',
        format: 'image/png',
        transparent: true,
        tileSize: 256,
        continuousWorld: true,
        attribution: '© Your WMTS Service'
    }).addTo(map);


</script>
</body>
</html>
